<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<html lang="en">
<head>
	<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
	<title>Python and the Unix Shell</title>
	<meta name="generator" content="BBEdit 6.5.3">
	<link rel="SHORTCUT ICON" href="pythonsmall.gif">
	<META NAME="AppleIcon" CONTENT="pythonsmall.gif">
</head>
<body>
<h1>Running Python scripts from the Unix Shell</h1>
		<table>
		<tr>
			<td>
				<img src="python.gif" width="128" height="128" align="top" alt="">
			</td>
			<td>
				<p>MacPython 2.3 installs a perfectly normal Unix commandline
				python interpreter in <tt>/usr/local/bin/python</tt>. As of Mac OS X 10.2, however,
				<tt>/usr/local/bin</tt> is not on the search path of your shell. Moreover,
				Apple's python 2.2, which lives in <tt>/usr/bin</tt> <em>is</em> on your
				search path, so this can lead to confusion.</p>
				
				<p>If you use <tt>tcsh</tt> you should add the following line
				to the file <tt>.login</tt> in your home directory and restart Terminal:
				<br>
				<tt>setenv PATH /usr/local/bin:$PATH</tt>
				</p>
				
				<p>If you use <tt>bash</tt> or <tt>zsh</tt>
				you should add the following line
				to the file <tt>.profile</tt> in your home directory and restart Terminal:
				<br>
				<tt>export PATH=/usr/local/bin:$PATH</tt>
				</p>
				
				<h2>GUI scripts</h2>
				
				<p>Due to the way MacOS handles windowing applications you need to run 
				<em>all</em> scripts that use the window manager (be it through
				Carbon, Cocoa, Tkinter, wxPython, PyOpenGL or anything else) with the
				<tt>pythonw</tt> interpreter, also installed in <tt>/usr/local/bin</tt>.</p>
				
				<p>Running with <tt>python</tt> results in an inability to bring the
				script to the front, or interacting with it. </p>
			</td>
		</tr>
		</table>
		<hr>
</body>
</html>
